/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.app.hotel.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
* @website https://el-admin.vip
* @description /
* @author Haojie Li
* @date 2021-03-28
**/
@Entity
@Data
@Table(name="app_hotel_fixed_assets")
public class HotelFixedAssets implements Serializable {

    @Id
    @Column(name = "id")
    @ApiModelProperty(value = "唯一数据标识")
    private String id;

    @Column(name = "no",nullable = false)
//    @NotBlank
    @ApiModelProperty(value = "资产号")
    private String no;

    @Column(name = "name",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "资产名称")
    private String name;

    @Column(name = "model_no")
    @ApiModelProperty(value = "资产型号")
    private String modelNo;

    @Column(name = "num",nullable = false)
    @NotNull
    @ApiModelProperty(value = "资产数量")
    private Integer num;

    @Column(name = "note")
    @ApiModelProperty(value = "备注")
    private String note;

    @Column(name = "logo")
    @ApiModelProperty(value = "logo")
    private String logo;

    @Column(name = "hotel_id")
    @ApiModelProperty(value = "所属酒店ID")
    private String hotelId;

    @Column(name = "hotel_no")
    @ApiModelProperty(value = "所属酒店编号")
    private String hotelNo;

    @Column(name = "hotel_name")
    @ApiModelProperty(value = "所属酒店名称")
    private String hotelName;

    @Column(name = "create_user")
    @ApiModelProperty(value = "创建人")
    private String createUser;

    @Column(name = "update_user")
    @ApiModelProperty(value = "更新人")
    private String updateUser;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    @Column(name = "is_enable")
    @ApiModelProperty(value = "数据状态")
    private Integer isEnable;

    public void copy(HotelFixedAssets source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}